home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / J A V A / Java Development Kit V1.2 / jdk12-win32(1).exe / data1.cab / demos / demo / jfc / Metalworks / Metalworks.java < prev    next >
Encoding:
Java Source  |  1998-12-01  |  1.8 KB  |  59 lines

  1. /*
  2.  * @(#)Metalworks.java    1.5 98/08/26
  3.  *
  4.  * Copyright 1998 by Sun Microsystems, Inc.,
  5.  * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
  6.  * All rights reserved.
  7.  *
  8.  * This software is the confidential and proprietary information
  9.  * of Sun Microsystems, Inc. ("Confidential Information").  You
  10.  * shall not disclose such Confidential Information and shall use
  11.  * it only in accordance with the terms of the license agreement
  12.  * you entered into with Sun.
  13.  */
  14.  
  15.  
  16. import java.awt.*;
  17. import javax.swing.*;
  18. import javax.swing.border.*;
  19.  
  20.  
  21. /**
  22.   * This application is a demo of the Metal Look & Feel
  23.   *
  24.   * @version 1.5 08/26/98
  25.   * @author Steve Wilson
  26.   */
  27. public class Metalworks {
  28.  
  29.     public static void main( String[] args ) {
  30.         try {
  31.         javax.swing.plaf.metal.MetalLookAndFeel.setCurrentTheme( new javax.swing.plaf.metal.DefaultMetalTheme());
  32.         UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
  33.     }  
  34.     catch ( UnsupportedLookAndFeelException e ) {
  35.         System.out.println ("Metal Look & Feel not supported on this platform. \nProgram Terminated");
  36.         System.exit(0);
  37.     }
  38.     catch ( IllegalAccessException e ) {
  39.         System.out.println ("Metal Look & Feel could not be accessed. \nProgram Terminated");
  40.         System.exit(0);
  41.     }
  42.     catch ( ClassNotFoundException e ) {
  43.         System.out.println ("Metal Look & Feel could not found. \nProgram Terminated");
  44.         System.exit(0);
  45.     }   
  46.     catch ( InstantiationException e ) {
  47.         System.out.println ("Metal Look & Feel could not be instantiated. \nProgram Terminated");
  48.         System.exit(0);
  49.     }
  50.     catch ( Exception e ) {
  51.         System.out.println ("Unexpected error. \nProgram Terminated");
  52.         e.printStackTrace();
  53.         System.exit(0);
  54.     }
  55.         JFrame frame = new MetalworksFrame();
  56.     frame.setVisible(true);
  57.     }
  58. }
  59.